package com.starlink.model.util;

import com.starlink.model.dtomapper.MallIntegrationDtoMapper;
import com.starlink.model.domain.MallIntegrationDO;
import com.starlink.model.vo.MallIntegrationVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class MallIntegrationConvert {

    public static List<MallIntegrationVO> buildMallIntegrationVoList(List<MallIntegrationDO> mallIntegrationDOList) {
        if (CollectionUtils.isEmpty(mallIntegrationDOList)) {
            return Lists.newArrayList();
        }
        List<MallIntegrationVO> mallIntegrationVOList = new ArrayList<>();
        for (MallIntegrationDO mallIntegrationDO : mallIntegrationDOList) {
            mallIntegrationVOList.add(MallIntegrationDtoMapper.INSTANCE.do2VO(mallIntegrationDO));
        }

        return mallIntegrationVOList;
    }
}
